/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2022-10-05
 * Time: 9:59
 */
interface Face{
    final static double  PI = 3.14;//定义常量
    //定义默认方法--计算面积
    public default double area(int r){
        return r*r*PI;
    }
    //定义抽象方法
    double volume(int r,double h);
    //定义静态方法
    public static String show(){
        return "我是静态方法";
    }




}
public class Test implements Face{
    //实现接口的方法
    @Override
    public double volume(int r, double h) {
        return area(r)*h;
    }

    public static void main(String[] args) {
        System.out.println(Face.show());
        Test t = new Test();
        System.out.println("圆柱的体积 = "+t.volume(1, 2.0));
    }
}
